package com.YHVision.qiuzhike.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.YHVision.qiuzhike.model.dto.company.CompanyQueryRequest;
import com.YHVision.qiuzhike.model.entity.Company;
import com.YHVision.qiuzhike.model.vo.CompanyVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 企业服务
 *
 * @author <a href="">YHVision-小y</a>
 * @from <a href="todo">爱编程学习圈</a>
 */
public interface CompanyService extends IService<Company> {

    /**
     * 校验数据
     *
     * @param company
     * @param add 对创建的数据进行校验
     */
    void validCompany(Company company, boolean add);

    /**
     * 获取查询条件
     *
     * @param companyQueryRequest
     * @return
     */
    QueryWrapper<Company> getQueryWrapper(CompanyQueryRequest companyQueryRequest);
    
    /**
     * 获取企业封装
     *
     * @param company
     * @param request
     * @return
     */
    CompanyVO getCompanyVO(Company company, HttpServletRequest request);

    /**
     * 分页获取企业封装
     *
     * @param companyPage
     * @param request
     * @return
     */
    Page<CompanyVO> getCompanyVOPage(Page<Company> companyPage, HttpServletRequest request);
}
